<?php 
/**
 * 前台分类页表控制器
 */
class CategoryController extends CommonController{
	public function index(){
		//获得分类表数据
		$Cate = K('category')->where("pid=0")->all();
		//重组数组
		foreach ($Cate as $k => $v) {
			$Cate[$k]['son'] = K('category')->where("pid={$v['cid']}")->all();
		}
		//分配数据到模板
		$this->assign('Cate',$Cate);
	    $this->display();
	}
}




 ?>